﻿#ifndef LIGHTCONTROLLER_H
#define LIGHTCONTROLLER_H


#include <QObject>
#include <QtSerialPort/QtSerialPort>


namespace dgkoma {

/**
 * @brief The LightController class 东莞科麦视觉科技有限公司的光源控制器的控制代码
 */
class LightController : public QObject
{
    Q_OBJECT
public:

    explicit LightController(QObject *parent = nullptr);

    bool open(QString comm);
    bool close();

    bool setLight(uint8_t ch, int level);
    bool readLight(uint8_t ch, uint8_t & level);
    bool turn_on(uint8_t ch);
    bool turn_off(uint8_t ch);
private:
    QSerialPort * m_serialPort;    
    int m_cmd;
};
}


#endif // LIGHTCONTROLLER_H
